<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'perfor_personal.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">   
	<link rel="stylesheet" type="text/css" href="css/table.css"> 
  </head>
  
  <body>
  <sql:query var="result"
		sql="select performance_emp_name,performance_date,performance_treat_type,performance_treat_amount,performance_reason from t_performance where performance_emp_id=${sessionScope.employee.emp_id}" />
   <table>
		<caption>部门信息</caption>
		<thead>
			<tr>
				<th>姓名</th>
				<th>时间</th>
				<th>类型</th>
				<th>数目</th>
				<th>原因</th>
			</tr>
		</thead>
		<tbody id="tab">
			<c:forEach var="row" items="${result.rowsByIndex}">
				<tr>
					<c:forEach var="column" items="${row}">
						<td><c:out value="${column}" />
						</td>
					</c:forEach>

				</tr>
			</c:forEach>
		</tbody>
	</table>
	<script type="text/javascript">
	<!--
		var Ptr = document.getElementById("tab").getElementsByTagName("tr");
		function $() {
			for (i = 1; i < Ptr.length + 1; i++) {
				Ptr[i - 1].style.backgroundColor = (i % 2 > 0) ? "#fff"
						: "#eee";
			}
		}
		window.onload = $;
		for ( var i = 0; i < Ptr.length; i++) {
			Ptr[i].onmouseover = function() {
				this.tmpClass = this.className;
				this.style.backgroundColor = "#ccc";

			};
			Ptr[i].onmouseout = function() {
				for (i = 1; i < Ptr.length + 1; i++) {
					Ptr[i - 1].style.backgroundColor = (i % 2 > 0) ? "#eee"
							: "#fff";
				}
			}
		}
	//-->
	</script>
  </body>
</html>
